Skip to content

fix(planning,control): stabilize reverse behavior and decouple front-distance reflex#124

Open
xiaolefang-dm wants to merge 18 commits into
mainfrom
xiaole/optimized/planning
Open

fix(planning,control): stabilize reverse behavior and decouple front-distance reflex#124
xiaolefang-dm wants to merge 18 commits into
mainfrom
xiaole/optimized/planning

Conversation

@xiaolefang-dm
Copy link
Copy Markdown
Contributor

@xiaolefang-dm xiaolefang-dm commented Apr 29, 2026

  • Move reverse selection into planning_node: regular trajectory sampling is now forward-only, with one predefined straight reverse candidate.
  • Gate reverse behavior using planner-side front-clearance detection instead of coupling front-obstacle reflex logic into cmd_vel_control.
  • Update trajectory generation from acceleration sampling to velocity-lattice sampling, and append predefined behavior vocabularies.
  • Simplify cmd_vel_control: pass reverse commands through directly as straight reverse (vyaw=0), keep smoothing only in the timer acceleration limiter, and apply rotate-first / force-turn gating only for forward motion.
  • Tune low-speed linear/angular deadbands for smoother low-speed control response.
  • Update GO2 geometry/safety parameters and obstacle-map filtering/dilation parameters used by planning.

@xiaolefang-dm xiaolefang-dm force-pushed the xiaole/optimized/planning branch from 7baa340 to ff67ae9 Compare April 29, 2026 08:30
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (253.8 files/s, 37212.9 lines/s)
Language files blank comment code
Python 13 611 263 3382
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 30 29 191
JSON 2 8 0 58
TOML 1 4 0 57
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 931 360 4867

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (248.4 files/s, 36501.9 lines/s)
Language files blank comment code
Python 13 611 265 3394
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 30 29 191
JSON 2 8 0 58
TOML 1 4 0 57
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 931 362 4879

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (245.3 files/s, 36040.9 lines/s)
Language files blank comment code
Python 13 611 265 3394
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 30 29 191
JSON 2 8 0 58
TOML 1 4 0 57
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 931 362 4879

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.13 s (331.1 files/s, 48654.9 lines/s)
Language files blank comment code
Python 13 611 265 3393
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 30 29 191
JSON 2 8 0 58
TOML 1 4 0 57
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 931 362 4878

xiaolefang and others added 11 commits April 29, 2026 22:11
target_pose is never cleared on arrival, so planning_node kept generating
paths and the robot never stopped. Now publishes an empty path once within
0.3m of target_pose so cmd_vel_control stale-path protection kicks in.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d check

target_pose is a camera-frame position (POI recorded as camera pose),
but previously compared against robot control center which is 0.35m
behind the camera, so dist_to_goal was always ~0.35m > 0.3m threshold.
Now compare T[:3,3] (camera position) directly to target_pose.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
map_node already detects arrival (dist < 0.5m) and publishes poi_change,
which clears target_pose in planning_node, which then publishes an empty
path to stop the robot. The dist_to_goal guard here is unreachable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed redundant path publishing when target_pose is None or all trajectories are in collision.
Keep planner forward-only and delegate reverse handling to cmd_vel, while adding front-obstacle reflex and simple rotate-first gating to reduce risky turn-and-go behavior.

Made-with: Cursor
Drop front_dist publisher coupling and keep reverse selection fully inside planning cost with single reverse candidate and front-clearance threshold gating.

Made-with: Cursor
Normalize EOF newlines for planning_node.py and cmd_vel_control.py.

Made-with: Cursor
Clean up unresolved conflict marker that caused ruff syntax failure in CI.

Made-with: Cursor
…amline velocity sampling

Added a new function to generate predefined trajectory vocabularies, allowing for future behaviors to be easily appended. Simplified the velocity sampling in the trajectory generation by removing the reverse sample and directly using a linear space for forward velocities. Updated trajectory generation in the PlanningNode to incorporate the new vocabulary, enhancing maneuvering capabilities.
@xiaolefang-dm xiaolefang-dm force-pushed the xiaole/optimized/planning branch from 59f7d8f to a7a9e12 Compare April 29, 2026 14:59
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (253.6 files/s, 37677.0 lines/s)
Language files blank comment code
Python 13 619 274 3444
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 30 29 191
JSON 2 8 0 58
TOML 1 4 0 57
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 939 371 4929

…fy comments

Updated the cost function in PlanningNode to improve clarity and maintainability. Introduced clearer comments regarding predefined backward trajectory penalties and streamlined the logic for determining when to apply reverse penalties. This refactor aims to enhance the understanding of trajectory evaluations and improve the overall planning logic.
@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.16 s (256.9 files/s, 38144.7 lines/s)
Language files blank comment code
Python 13 619 273 3443
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 30 29 191
JSON 2 8 0 58
TOML 1 4 0 57
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 939 370 4928

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.13 s (319.0 files/s, 47378.8 lines/s)
Language files blank comment code
Python 13 619 273 3443
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 30 29 191
JSON 2 8 0 58
TOML 1 4 0 57
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 939 370 4928

@xiaolefang-dm xiaolefang-dm requested a review from dvorak0 April 29, 2026 15:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (248.2 files/s, 37037.0 lines/s)
Language files blank comment code
Python 13 621 273 3458
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 31 30 202
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 942 371 4955

@xiaolefang-dm xiaolefang-dm force-pushed the xiaole/optimized/planning branch from 959795c to a902327 Compare May 9, 2026 00:51
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (243.6 files/s, 36359.8 lines/s)
Language files blank comment code
Python 13 621 273 3458
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 31 30 202
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 942 371 4955

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

cloc github.com/AlDanial/cloc v 2.04 T=0.20 s (209.4 files/s, 31380.0 lines/s)
Language files blank comment code
Python 13 625 279 3474
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 31 30 202
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 946 377 4971

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (248.4 files/s, 37593.1 lines/s)
Language files blank comment code
Python 13 630 285 3526
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 31 30 202
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 951 383 5023

go2 config update
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (251.3 files/s, 38036.5 lines/s)
Language files blank comment code
Python 13 630 285 3526
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 31 30 202
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 951 383 5023

@github-actions
Copy link
Copy Markdown

cloc github.com/AlDanial/cloc v 2.04 T=0.17 s (249.4 files/s, 37745.5 lines/s)
Language files blank comment code
Python 13 630 287 3524
Markdown 4 155 6 426
C++ 4 60 38 409
Bourne Shell 15 41 9 272
Dockerfile 1 31 30 202
JSON 2 8 0 58
TOML 1 4 0 58
make 1 18 15 55
CMake 1 4 0 17
-------- -------- -------- -------- --------
SUM: 42 951 385 5021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant